package com.ruoyi.project.bajiaostar.tUserAmountDetail.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.bajiaostar.tUserAmountDetail.mapper.TUserAmountDetailMapper;
import com.ruoyi.project.bajiaostar.tUserAmountDetail.domain.TUserAmountDetail;
import com.ruoyi.project.bajiaostar.tUserAmountDetail.service.ITUserAmountDetailService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 账户流水明细Service业务层处理
 * 
 * @author wangwu
 * @date 2024-05-23
 */
@Service
public class TUserAmountDetailServiceImpl implements ITUserAmountDetailService 
{
    @Autowired
    private TUserAmountDetailMapper tUserAmountDetailMapper;

    /**
     * 查询账户流水明细
     * 
     * @param id 账户流水明细ID
     * @return 账户流水明细
     */
    @Override
    public TUserAmountDetail selectTUserAmountDetailById(Long id)
    {
        return tUserAmountDetailMapper.selectTUserAmountDetailById(id);
    }

    /**
     * 查询账户流水明细列表
     * 
     * @param tUserAmountDetail 账户流水明细
     * @return 账户流水明细
     */
    @Override
    public List<TUserAmountDetail> selectTUserAmountDetailList(TUserAmountDetail tUserAmountDetail)
    {
        return tUserAmountDetailMapper.selectTUserAmountDetailList(tUserAmountDetail);
    }

    /**
     * 新增账户流水明细
     * 
     * @param tUserAmountDetail 账户流水明细
     * @return 结果
     */
    @Override
    public int insertTUserAmountDetail(TUserAmountDetail tUserAmountDetail)
    {
        tUserAmountDetail.setCreateTime(DateUtils.getNowDate());
        return tUserAmountDetailMapper.insertTUserAmountDetail(tUserAmountDetail);
    }

    /**
     * 修改账户流水明细
     * 
     * @param tUserAmountDetail 账户流水明细
     * @return 结果
     */
    @Override
    public int updateTUserAmountDetail(TUserAmountDetail tUserAmountDetail)
    {
        tUserAmountDetail.setUpdateTime(DateUtils.getNowDate());
        return tUserAmountDetailMapper.updateTUserAmountDetail(tUserAmountDetail);
    }

    /**
     * 删除账户流水明细对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTUserAmountDetailByIds(String ids)
    {
        return tUserAmountDetailMapper.deleteTUserAmountDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除账户流水明细信息
     * 
     * @param id 账户流水明细ID
     * @return 结果
     */
    @Override
    public int deleteTUserAmountDetailById(Long id)
    {
        return tUserAmountDetailMapper.deleteTUserAmountDetailById(id);
    }

    @Override
    public TUserAmountDetail findTUserAmountDetailByOrderId(Long orderId) {
        return tUserAmountDetailMapper.findTUserAmountDetailByOrderId(orderId);
    }

    @Override
    public Integer findSystemStayPayAmount() {
        return tUserAmountDetailMapper.findSystemStayPayAmount();
    }

    @Override
    public Integer findSystemFlatPayAmountCount() {
        return tUserAmountDetailMapper.findSystemFlatPayAmountCount();
    }

    @Override
    public int deleteTUserAmountDetail(Long orderId, Integer orderType, String orderNo, Long userId) {
        return tUserAmountDetailMapper.deleteTUserAmountDetail(orderId,orderType,orderNo,userId);
    }

    @Override
    public TUserAmountDetail findTUserAmountDetail(Long orderId, Integer orderType, String orderNo, Long userId) {
        return tUserAmountDetailMapper.findTUserAmountDetail(orderId,orderType,orderNo,userId);
    }
}
